function getSum(arr) {
    // console.log(arr);
    var newArr = [];
    arr.forEach(function (item) {
        if (typeof (item) == "number") {
            newArr.push(item);
        }
    });
    for (var index = 0; index < newArr.length; index++) {
        if (newArr[index] == newArr[index + 1]) {
            newArr.splice(index, 1);
            index--;
        }
    }
    // console.log(newArr);
    var num = 0;
    num = newArr.reduce(function (prev, cur) {
        return prev + cur;
    }, 0);
    return num;
}
console.log(getSum([undefined, "23year", 19, "097", 1, "hello", null, 1]));
